package com.prs.crm.domain.crm;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.prs.crm.domain.BaseEntity;
/**
 * 客户来源
 * @author zhoupeng 2012-3-1
 *
 */
@Entity
@Table(name="crm_customer_source")
public class CustomerSource extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String name;  //类别名称
	private String remark;  //说明
	//客户
	@OneToMany(fetch=FetchType.LAZY,mappedBy="source")
	private Set<Customer> customers;
	//代理商
	@OneToMany(fetch=FetchType.LAZY,mappedBy="source")
	private Set<CustomerAgent> agents;
	//供应商
	@OneToMany(fetch=FetchType.LAZY,mappedBy="source")
	private Set<CustomerSupplier> suppliers;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Set<Customer> getCustomers() {
		return customers;
	}
	public void setCustomers(Set<Customer> customers) {
		this.customers = customers;
	}
	public Set<CustomerAgent> getAgents() {
		return agents;
	}
	public void setAgents(Set<CustomerAgent> agents) {
		this.agents = agents;
	}
	public Set<CustomerSupplier> getSuppliers() {
		return suppliers;
	}
	public void setSuppliers(Set<CustomerSupplier> suppliers) {
		this.suppliers = suppliers;
	}
	
}
